package lagou.homework.lagouhomework.Unit2.q3.code;
/**
 * 手机卡类 特征：卡类型、卡号、用户名、密码、账户余额、通话时长(分钟)、上网流量 行为：显示（卡号 + 用户名 + 当前余额） 
 * */
public class PhoneCard {
    private CardType cardType;    // 卡类型 //改写
    private String phoneNum;       // 卡号,11位超过了int的范围，因此改为String
    private String userName;    // 用户名
    private String password;    // 密码
    private double  accountBalance; // 账户余额
    private int  callTime;      // 通话时长(分钟)
    private int   netFlow;      // 上网流量

    public PhoneCard() {
    }

    public PhoneCard(CardType cardType, String phoneNum, String userName, String password, double accountBalance, int callTime, int netFlow) {
        setCardType(cardType);
        setPhoneNum(phoneNum);
        setUserName(userName);
        setPassword(password);
        setAccountBalance(accountBalance);
        setCallTime(callTime);
        setNetFlow(netFlow);
    }

    public CardType getCardType() {
        return cardType;
    }

    public void setCardType(CardType cardType) {
        this.cardType = cardType;
    }

    public String getPhoneNum() {
        return phoneNum;
    }

    public void setPhoneNum(String phoneNum) {
        this.phoneNum = phoneNum;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public double getAccountBalance() {
        return accountBalance;
    }

    public void setAccountBalance(double accountBalance) {
        this.accountBalance = accountBalance;
    }

    public  int getCallTime() {
        return callTime;
    }

    public  void setCallTime(int callTime) {
        this.callTime = callTime;
    }

    public int getNetFlow() {
        return netFlow;
    }

    public void setNetFlow(int netFlow) {
        this.netFlow = netFlow;
    }

    public void phoneCardShow(){
        System.out.println("卡号为:" + getPhoneNum() + ", 用户名为:" + getUserName() + ",当前余额为：" +getAccountBalance());
    }

    public void showInfo(){
        System.out.println("卡号为:" + getPhoneNum() + ", 用户名为:" + getUserName() + "，通话时长为:" + getCallTime()+"分钟，上网流量为："+getNetFlow()+"M");
    }
}
